<?php
namespace GrouppaGroup;
require_once 'Controller.php';
require_once 'MessageFromApp.php';
require_once 'MessageFromServer.php';
require_once 'Task.php';
require_once 'Planning.php';

class PlanningController extends Controller
{

    /**
     * receives a message from an application (override from controller)
     * @param  MessageFromApp    $message
     * @return MessageFromServer return message to the user
     */
    public function receiveMessage(MessageFromApp $message)
    {
        //TODO: handle received message
    }

    /*
    ****************** Section: functions available to call for the applications
    */

    /**
     * gets a list of tasks of specified user
     * @param  string $userName
     * @return array  array of Task
     */
    public function getTasks(string $userName)
    {
        //TODO: get all tasks from specified user and convert them to array
    }

    /**
     * adds a new task to current user
     * @param  Task    $task task to be added
     * @return boolean true iff task was added
     *
     */
    public function addTask(Task $task)
    {
        //TODO: add a task for the current user
    }

    /**
     * remove a task from current user
     * @param  Task    $task task to be removed
     * @return boolean true iff task was removed
     */
    public function removeTask(Task $task)
    {
        //TODO: remove a task from the current user
    }

    /**
     * adds some time spent by current user an a specified task
     * @param  Task    $task task on which user spent time
     * @param  int     $time amount of time that user spent on the task (in minutes)
     * @return boolean true iff
     */
    public function addTimeToTask(Task $task, int $time)
    {
        //TODO: add time spent on a task by current user
    }

    /**
     * saves planning to a server for a specified user
     * @param  Planning $plan planning to save
     * @return boolean  true iff planning was saved
     */
    public function savePlanning(Planning $plan)
    {
        //TODO: save planning on a server
    }

}
